package com.ruoyi.central.cmd;

import com.ruoyi.central.domain.TopCentralTaskCmd;
import com.ruoyi.central.domain.TopCentralTaskCmdRun;

/**
 * @Classname AbstractTaskCmd
 * @Author: sunluquan
 * @Date: 2022/6/13 10:24
 * @Description TODO
 *
 */
public abstract class AbstractTaskCmd {

    private TopCentralTaskCmd taskCmd ;

    private TopCentralTaskCmdRun taskCmdRun ;

    private Object [] params ;

    /**
     * 初始化参数
     * @param taskCmd
     * @param taskCmdRun
     * @param params
     */
    public void init(TopCentralTaskCmd taskCmd ,TopCentralTaskCmdRun taskCmdRun ,Object [] params ){
        this.taskCmd = taskCmd;
        this.taskCmdRun = taskCmdRun;
        this.params = params;
    }

    /**
     * 指令任务执行前调用函数
     * @throws Exception
     */
    public  void performBefore() throws Exception{};

    /**
     * 指令任务执行调用函数
     * @throws Exception
     */
    public abstract void perform() throws Exception;

    /**
     * 指令任务执行后调用函数
     * @throws Exception
     */
    public void performAfter() throws Exception{};

}
